package com.yfp.client.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yfp.client.domain.AiModelService;
import com.yfp.client.domain.vo.AiModelServiceInfoVO;
import org.springframework.ai.openai.OpenAiChatOptions;
import org.springframework.ai.openai.api.OpenAiApi;
import reactor.core.publisher.Flux;

/**
 *
 * @description 针对表【ai_model_service(AI模型服务表)】的数据库操作Service
 * @createDate 2025-02-25 15:10:18
 */
public interface AiModelServiceService extends IService<AiModelService> {

    /**
     * 获取当前激活的模型服务
     *
     * @return
     */
    AiModelServiceInfoVO searchActiveModel();

    /**
     * 调用模型服务-非流式
     *
     * @return
     */
    String chatCall(String message);

    /**
     * 调用模型服务-流式
     *
     * @return
     */
    Flux<String> chatStream(String message);

    /**
     * 构建ChatOptions配置
     *
     * @param aiModelServiceInfoVO
     * @return
     */
    OpenAiChatOptions buildChatOptionsConfig(AiModelServiceInfoVO aiModelServiceInfoVO);

    /**
     * 构建OpenAiApi配置
     *
     * @param aiModelServiceInfoVO
     * @return
     */
    OpenAiApi buildOpenAiApiConfig(AiModelServiceInfoVO aiModelServiceInfoVO);
}
